<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>课程管理</title>
	<%@ include file="/pages/common/head_base.jsp"%>

	<script type="text/javascript">
		$(function () {
			$("a.deleteClass").click(function () {
				return confirm("你确定要删除课程号为" + $(this).parent().parent().find("td:first").text() + "的课程吗?");
			})
		})
	</script>

</head>
<body>
	
	<div id="header">
			<span class="wel_word">课程管理</span>
		<%@ include file="/pages/common/manager_menu.jsp"%>
	</div>
	
	<div id="main">

		<table>
			<tr>
				<td>课程号</td>
				<td>课程名</td>
				<td>先修课程号</td>
				<td>学分</td>
				<td colspan="3">操作</td>
			</tr>

			<c:forEach items="${requestScope.courseList}" var="course">
				<tr>
					<td>${course.cno}</td>
					<td>${course.cname}</td>
					<td>${course.cpno}</td>
					<td>${course.ccredit}</td>
					<td><a href="courseServlet?action=teacherFindById&cno=${course.cno}">修改</a></td>
					<td><a class="deleteClass" href="courseServlet?action=delete&cno=${course.cno}">删除</a></td>
					<td><a href="scServlet?action=findS_SC_S&cno=${course.cno}">选课详情</a></td>
				</tr>
			</c:forEach>

			<tr>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td></td>
				<td><a href="pages/manager/course_edit.jsp">添加课程</a></td>
				<td><a href="courseServlet?action=exportXLS">导出报表</a></td>
			</tr>
		</table>
	</div>
	<%@ include file="/pages/common/footer.jsp"%>
</body>
</html>